package ch03_test;

public class Pro1 {
	public static void main(String[] args) {
		int n, t, s = 0;
		for (n = 1; s <= 10000; n++) {
			t=1;
			for (int i = 1; i <= n; i++) {
				
				t *= i;
			}
			s += t;
		}
		System.out.println(s);
		System.out.println(n - 1);
	}
}
